import axios from 'axios'

// import Constants from 'expo-constants'

// const debuggerHost = Constants.expoConfig?.hostUri
// console.log(debuggerHost, 'debuggerHost')

import { getApiUrl, getLocalhost, replaceLocalhost } from './server'

var axiosApi = axios.create({
    baseURL: getApiUrl(),
    timeout: 5000
})


axiosApi.interceptors.request.use(
    function (config) {
        return config
    },
    function (error) {
        return Promise.reject(error)
    }
)

axiosApi.interceptors.response.use(
    function (response) {
        return response
    },
    function (error) {
        return Promise.reject(error)
    }
)

export default axiosApi